Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[chip,dv] flash_ctrl memory protection test #20800

Merged
merged 1 commit into from
Jan 18, 2024

Conversation

jdonjdon
Copy link
Contributor

@jdonjdon jdonjdon commented Jan 10, 2024

Test for flash_ctrl multi mp regions and their priority.
Test verified in simulation platform.
sival target will be added in the subsequent PR.

@jdonjdon jdonjdon requested review from a team as code owners January 10, 2024 01:18
@jdonjdon jdonjdon requested review from hcallahan-lowrisc, jon-flatley, moidx, timothytrippel and matutem and removed request for a team January 10, 2024 01:18
* FLASH_CTRL memory protection test
*
* This test checks multiple memory protection regions and priority in case
* any regions are overrapped.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* any regions are overrapped.
* any regions overlap.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed.

&flash, /*rd_en=*/true, /*prog_en=*/true, /*erase_en=*/true,
/*scramble_en=*/false, /*ecc_en=*/false, /*high_endurance_en=*/false));

for (int i = 2; i >= 0; i--) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am curious: should the test have two loops here, one that sets all region properties, and another one that does test_mem_access? This way test_mem_access will be certain to run with properties set as described above.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Each loop it programs table entry)
to cover multiple MP regions.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I understand: each time you create a new region overlapping previous regions starting at a lower page, so it has higher priority. If you agree this is how it works, please change the text around line 34 to reflect this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@matutem , test program higher region first, which has "lower" priority.
Then subsequent programming with lower region will overruled previous config parameter because
lower region number has "higher" priority.

Copy link
Contributor

@hcallahan-lowrisc hcallahan-lowrisc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test LGTM, though I would wait for another more-familiar reviewer to approve as well.

One question. Is it worth covering bank 0 as well in this test?

@jdonjdon jdonjdon requested a review from matutem January 17, 2024 18:01
Copy link
Contributor

@matutem matutem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Jaedon, I added a comment with my understanding of the logic of the test. If it is accurate it can be used to enhance the comments near line 34 of the .c file, since the test is not obvious otherwise.

I'll leave it up to you to decide what to do.

LGTM

Test for multi mp region and their priority.
Test verified in simulation platform.
sival target will be added in the subsequent PR.

Signed-off-by: Jaedon Kim <[email protected]>
@jdonjdon
Copy link
Contributor Author

Jaedon, I added a comment with my understanding of the logic of the test. If it is accurate it can be used to enhance the comments near line 34 of the .c file, since the test is not obvious otherwise.

I'll leave it up to you to decide what to do.

LGTM

Thanks, @matutem Comment has been updated as suggested.

@jdonjdon jdonjdon merged commit ffe3a9d into lowRISC:master Jan 18, 2024
31 of 32 checks passed
@jdonjdon jdonjdon mentioned this pull request Jan 21, 2024
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants